<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue/vue.js"></script>
</head>
<body>

<!--v-bind属性绑定--->

<div id="app">
    <ul>
        <li v-for="item in arr">{{item}}</li>
    </ul>

    <ul>    <!-- item, index 变量名，名字随便写 -->
            <!-- v-for="(元素, 索引) in 数组/集合" -->
        <li v-for="(item, index) in arr">{{item}}--{{index}}</li>
    </ul>

    <ul>  <!-- 对象集合的遍历 -->
        <li v-for="e in emps">{{e.id}}--{{e.name}}--{{e.age}}--{{e.sex}}</li>
    </ul>
</div>
<script>
    var vue = new Vue({
        el:"#app",
        data:{
            arr: ["a", "b", "c", "d"],
            emps:[
                {id:1, name:"dafei", age:18, sex:1},
                {id:2, name:"xiaofei", age:17, sex:1},
                {id:3, name:"xiaobin", age:16, sex:0},
                {id:4, name:"yanglong", age:10, sex:1}
            ]
        }
    })
</script>
</body>
</html>